<?php
include_once 'Classes/Register.class.php';
include_once 'Classes/DBConnection.class.php';

if (isset($_POST['txtUsername'])) {

    $regis = new Register();
    if (!$regis->regis($_POST['txtUsername'], $_POST['txtPassword'])) {
        print '<div style="font-weight: bold; color: #F00;">
                <div align="center">Username หรือ Password ผิด<br/>กรุณาลองใหม่</div>
                </div>';
    }
}
?>


<div align="center">

    <form action="" method="post" id="formLogin">
        <table width="300" border="0" cellspacing="1" cellpadding="1">
            <tr>
                <td width="81"><div align="right">username:</div></td>
                <td width="212"><label for="txtUsername"></label>
                    <input name="txtUsername" type="text" id="txtUsername" size="30" maxlength="50" /></td>
            </tr>
            <tr>
                <td><div align="right">password:</div></td>
                <td><label for="txtPassword"></label>
                    <input name="txtPassword" type="password" id="txtPassword" size="30" maxlength="10" /></td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><input type="submit" name="btnLogin" id="btnLogin" value="Login" /></td>
            </tr>
        </table>
    </form></div>


